export default {
    data() {
        return {
            loading: false,
            page: 1,
            pageSize: 10,
            total: 0,
            dataSource: [],
            pagination: {
                current: this.page,
                pageSize: this.pageSize,
                total: this.total,
                showSizeChanger: true,
                showLessItems: true,
                showQuickJumper: true,
                showTotal: (total, range) =>
                    `第 ${range[0]}-${range[1]} 条，总计 ${total} 条`,
                onChange: this.onPageChange,
                onShowSizeChange: this.onSizeChange,
            },
        }
    },
    mounted () {
        this.fetch()
    },
    methods: {
        onSizeChange (current, size) {
            this.page = 1
            this.pageSize = size
            this.fetch()
        },
        onRefresh (conditions) {
            //   this.conditions = conditions
            this.fetch()
        },
        onReset (conditions) {
            //   this.conditions = conditions
            this.fetch()
        },
        onPageChange (page, pageSize) {
            this.page = page
            this.pageSize = pageSize
            this.fetch()
        },
    }
}